<?php

ob_start();
chdir(__DIR__);

try {
	require 'library/Zend/Loader/AutoloaderFactory.php';

	Zend\Loader\AutoloaderFactory::factory(array(
		'Zend\Loader\StandardAutoloader' => array(
			'autoregister_zf' => true
		)
	));

	///Start session
	$Session = new Zend\Session\SessionManager();
	$Session->start();

	Zend\Mvc\Application::init(require 'config/config.php')->run();
} catch (Exception $e) {
	do {
		echo '<h3>', $e->getMessage(), '</h3>';
		echo '<pre>', $e->getTraceAsString(), '</pre>';
	} while ($e = $e->getPrevious());
	///Logging
}

ob_end_flush();
?>